﻿(function () {

    var roamingSettings = Windows.Storage.ApplicationData.current.roamingSettings;

    var changeTheme = function () {
        var switcher = document.getElementById("theme-switcher");
        var lightTheme = document.getElementById("light-theme");
        var darkTheme = document.getElementById("dark-theme");

        switcher.addEventListener("click", function () {
            if (roamingSettings.values['theme'] == "light") {
                darkTheme.disabled = false;
                lightTheme.disabled = true;
                roamingSettings.values['theme'] = "dark";
            }
            else {
                darkTheme.disabled = true;
                lightTheme.disabled = false;
                roamingSettings.values['theme'] = "light";
            }
        });
    };

    WinJS.Namespace.define("Theme", {
        changeTheme: changeTheme
    });
})();